#!/usr/bin/env python

import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dalton import Filter, TestRun

test = TestRun(__file__, sys.argv)

f = Filter()

f.add(string = 'Nuclear repulsion energy',
      rel_tolerance = 1.0e-10)

f.add(from_string = 'Wave function specification',
      num_lines = 52,
      rel_tolerance = 1.e-10)

f.add(string = 'Number of coordinates in each symmetry')
f.add(string = 'Number of orbitals in each symmetry')

f.add(string = 'Hartree-Fock total energy',
      rel_tolerance = 1.0e-8)
f.add(string = 'Final MC-SRDFT energy:',
      rel_tolerance = 1.0e-8)

f.add(from_string = 'Occupancies of natural orbitals',
      to_string = 'Head-Gordon',
      abs_tolerance = 1.0e-5)


test.run(['energy_openshell_tpss.dal'], ['water.mol'], f={'out': f})

sys.exit(test.return_code)
